Repository navigation
fix: clean text items read from files, tie plug-in consent to the settings key, start Windows agent shims safely - #17
Merged
Conversation
parasHtml now accepts only the known alignments and list kinds and whole-number levels and start numbers, so a text item's paragraph settings can never add markup to the editor.
Text items stored in a PDF were returned as the file holds them, while the paragraph and font cleaning ran only on writes. Reading items now runs the same cleaning, so alignments, lists, levels, start numbers and colours come back as known values. Adds a test.
Turning a plug-in on in the window now stores a mark made with the keychain key that already seals agent access. A plug-in counts as on only when its mark matches, so a consent written into settings.json by hand leaves the plug-in off until the person turns it on in Preferences. Without a usable keychain the stored consent stands, as for the agent choice. Adds tests.
Paragraph cleaning now treats paragraphs or runs that are not lists as empty, so one odd text item no longer stops a whole page of items from being read. Adds a test.
parasHtml skips paragraphs and runs that are not objects and turns run text and colour into strings before escaping them.
Checks that a mark made for one plug-in does not turn on another, and that turning a plug-in on stores its mark.
On Windows an npm .cmd shim now runs as the node script it names, inside its own folder, so the words reach the program unchanged. Any other .cmd or .bat still goes through cmd.exe, which now refuses control characters, percent signs and double quotes, and its special characters in a word that is not quoted. A refused start reads as a program that does not start, and the dock answers 400. The shared finder becomes version 1.0.2 with its hash recorded. Adds tests.
When a .cmd or .bat still has to start through cmd.exe, any word holding & | < > ^ ( ) ! % " or a control character is now refused, quoted or not, since the interpreter and a batch file's %* read them as commands even inside quotes. The refusal tells the caller to pass long text through standard input or a file, or to point the setting at the program itself. npm shims keep running as the node script or exe they name, with no interpreter. The recorded hash for the shared finder 1.0.2 is updated. Adds tests for both paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tests
For the owner
How to ship